/*
 * Copyright 2009 Sid Stamm <sid@sidstamm.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Author:
 * Sid Stamm <sid@sidstamm.com>
 */
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");

const Cc = Components.classes;
const Ci = Components.interfaces;

function AboutLockedCert() { }

AboutLockedCert.prototype = {
  newChannel: function(aURI)
  {
    if(!aURI.spec == "about:lockedcert") return;
    var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
    var channel = ios.newChannel("chrome://certlock/content/aboutLockedCert.xhtml", null, null);
    channel.originalURI = aURI;
    return channel;
  },

  getURIFlags: function(aURI)
  {
    return Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT;
  },

  classDescription: "About lockedcert error page",
  classID: Components.ID("{273a85a3-452f-42ee-a893-9038567dd11c}"),
  contractID: "@mozilla.org/network/protocol/about;1?what=lockedcert",
  QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
}

function NSGetModule(cmpMgr, fileSpec) {
  return XPCOMUtils.generateModule([AboutLockedCert]);
}
